package com.bxd.baodan.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.bxd.baodan.R;
import com.bxd.baodan.list.MessageListFragment;

public class MessageNextActivity extends BaseActivity {
    private MessageListFragment list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.single_frame);
        setActionBarTitle("消息");
        ((TextView) findViewById(R.id.tv_bar_right)).setText("全部已读");
        findViewById(R.id.tv_bar_right).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        list.allRead();
                    }
                }
        );

        String[] msg_types = getIntent().getStringArrayExtra("type");
//		// 加载消息列表
        list = (MessageListFragment) MessageListFragment.newInstance(msg_types);

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.content_frame, list).commit();
    }
}
